AudioCDRipper1.StopRip 'Cancel AudioRipber to read track
End If
End Sub
Private Sub cmdRefresh_Click() 'this sub starts when the user click the "Refresh" button
Inactive 'Inactive all form controls, that can't be used during the disc refresh
RefreshCD 'Calls the RefreshCD sub
Active 'Active all form controls, that can't be used during the disc refresh
End Sub
Private Sub Eject_Click() 'this sub starts when the user click the "Eject" button
txtDriveStatus.Caption = "Eject Disk" 'informs user about Eject Disc starts
AudioCDRipper1.Refresh 'Refresh the CD
AudioCDRipper1.Eject 'UnLock drive if it was locked and eject the CD
txtDriveStatus.Caption = "Idle" 'informs user about the end of Eject operation
End Sub
Private Sub GetCDDBButton_Click() 'this sub starts when the user click the "Refresh" button
Dim CDDBInfoEnable As Boolean 'declares the variable, that is true when CDDB information is availabel
AudioCDRipper1.cddbServerAddress = ServerAddr.Text 'Sets CDDB Server address to the one written in the ServerAddr TextBox
AudioCDRipper1.cddbCGIScript = CGIAddr.Text 'Sets CGI Script Relative Address to the one written in the CGIAddr textbox
AudioCDRipper1.cddbAgentName = Agent.Text 'Sets Agent Name (Apllication) to the one written in the Agent textBox
AudioCDRipper1.cddbUserEMail = EMail.Text 'Sets User E-Mail Address to the one written in the Email textbox
AudioCDRipper1.cddbTimeOut = txtCDDBTimeOut.Text 'sets the CDDB query timeout, if query is timed out it will be cancelled and CDDB information will not availabel
If (optCDDBAny.Value) Then 'Sets the CDDB source for query
CDDBInfoEnabled = AudioCDRipper1.GetCDDBInfo(All) 'ALL means using cdplayer.ini or CDDB server, if any internet connection is availabel
End If
If (optCDDBOnLine.Value) Then
CDDBInfoEnabled = AudioCDRipper1.GetCDDBInfo(ONLINEDATABASE) 'ONLINEDATABASE will query internet CDDB server, if any internet connection is availabel
End If
If (optCDPLAYERINI.Value) Then
CDDBInfoEnabled = AudioCDRipper1.GetCDDBInfo(CDPLAYERINI) 'CDPLYERINI means using cdplayer.ini file on local computer
End If
ServerAddr.Text = AudioCDRipper1.cddbServerAddress 'Writes the current Server address to the ServerAddr textbox
CGIAddr.Text = AudioCDRipper1.cddbCGIScript 'Writes the current CGI Script Relative Address to the CGIAddr textbox
Agent.Text = AudioCDRipper1.cddbAgentName 'Writes the current Agent Name (Apllication) to the Agent textbox
EMail.Text = AudioCDRipper1.cddbUserEMail 'Writes the current E-Mail Address to the EMail textbox
txtCDDBTimeOut.Text = AudioCDRipper1.cddbTimeOut 'Writes the CDDB timeout value to the CDDBTimeOut text box
If (CDDBInfoEnabled) Then 'if cddb info is enabled (or available) then
txtAlbum.Text = AudioCDRipper1.cddbInfoAlbum 'Writes the album name to the Album textbox
txtArtist.Text = AudioCDRipper1.cddbInfoArtist 'Writes the artist name to the Artist textbox
txtGenre.Text = AudioCDRipper1.cddbInfoGenre 'Writes the music genre name to the Genre textbox
txtTitle.Text = AudioCDRipper1.cddbInfoTitle 'Writes the track title (name) to the Title textbox
Else 'otherwise
MsgBox "No CDDB Information available! Try other CDDB source.", vbExclamation 'produces the message box that CDDB info is not available
End If
StatusBar1.Panels(4).Text = "CDDB Status: IDLE" 'Informs user that no CDDB queries in progress
End Sub
Private Sub chkUseExtASPI_Click() 'this sub starts when the user checks or unchecks "Use External ASPI" check box
If chkUseExtASPI.Value = 1 Then 'if user checks the check box
error = False
AudioCDRipper1.ripUseExternalASPI = True 'Sets AudioRipber to distonnect from Native SCSI interface and connect to user's ASPI interface
Inactive 'Inactive form controls, that cannot be used during the refresh operation
RefreshCD 'Calls the RefreshCD sub
Active 'Active form controls, , that cannot be used during the refresh operation
If error = True Then 'if error occures
error = False
MsgBox "Error load external ASPI! Rollback to Native SCSI Interface!" 'informs the user about error
AudioCDRipper1.ripUseExternalASPI = False 'rollback to the native SCSI Interface
chkUseExtASPI.Value = 0 'uncheks the checkbox
Inactive 'Inactive form controls, that cannot be used during the refresh operation
RefreshCD 'Calls the RefreshCD sub
Active 'Active form controls, , that cannot be used during the refresh operation
Else 'if it was no errors
MsgBox "External ASPI Interface in use now!" 'informs user that external interface connected
End If
Else 'if user uncheks the check box
AudioCDRipper1.ripUseExternalASPI = False 'Sets AudioRipber to disconnect from external interface and connect to Native SCSI interface
Inactive 'Inactive form controls, that cannot be used during the refresh operation
RefreshCD 'Calls the RefreshCD sub
Active 'Active form controls, , that cannot be used during the refresh operation
MsgBox "Native SCSI Interface in use now!" 'informs the user that control connects to native SCSI interface
End If
End Sub
Private Sub chkDriveLockTray_Click() 'this sub starts when the user checks or unchecks the "Lock Tray On Rip" check box
AudioCDRipper1.driveLockCDTrayDuringRip = chkDriveLockTray.Value 'Sets the driveLockCDTrayDuringRip
End Sub
Private Sub optAny_Click() 'this sub starts when the user click on Auto Option
AudioCDRipper1.driveReadType = CDRT_ANY 'Sets AudioRipber to Auto Detect drive interface befor the read operation starts
End Sub
Private Sub optIDE_Click() 'this sub starts when the user click on IDE Option
AudioCDRipper1.driveReadType = CDRT_ATAPI1 'Sets AudioRipber to use read commands in according to ATAPI(IDE, official) specification
End Sub
Private Sub optSCSI1_Click() 'this sub starts when the user click on SCSI(old) Option
AudioCDRipper1.driveReadType = CDRT_READ6 'Sets AudioRipber to use read commands in according to SCSI(old, SBC) specification
End Sub
Private Sub optSCSI2_Click() 'this sub starts when the user click on SCSI Option
AudioCDRipper1.driveReadType = CDRT_READ10 'Sets AudioRipber to use read commands in according to SCSI(SBC2) specification
End Sub
Private Sub optCut_Click() 'this sub starts when the user click on Cut Option
AudioCDRipper1.ripOnErrorAction = CUT 'Sets AudioRipber to cut the error blocks, contained unrecovered data
End Sub
Private Sub optSilence_Click() 'this sub starts when the user click on Silence Option
AudioCDRipper1.ripOnErrorAction = SILENCE 'Sets AudioRipber to insert the same duration silence on error blocks, contained unrecovered data
End Sub
Private Sub optStop_Click() 'this sub starts when the user click on Stop Option
AudioCDRipper1.ripOnErrorAction = STOPGRAB 'Sets AudioRipber to stop rip if it is an unrecovery read error
End Sub
Private Sub optCorrect_Click() 'this sub starts when the user click on Correct Option
AudioCDRipper1.ripOnErrorAction = CORRECT 'Sets AudioRipber to use error correction agorithm to remove "glitches" in audio signal on error blocks, contained unrecovered data
End Sub
Private Sub optBurst_Click() 'this sub starts when the user click on Burst Option
AudioCDRipper1.ripModePreset = BURST 'Sets Audio Ripber rip preset to BURST
txtRipRetriesOnError.Text = AudioCDRipper1.ripOnErrorRetries 'Writes Burst preset ripOnErrorRetries into the Retries on Read or Synch error text box
txtSpinUpTime.Text = AudioCDRipper1.driveSpinUpTime 'Writes Burst preset spinUpTime into the Spin Up Time text box
txtDriveSpeed.Text = AudioCDRipper1.driveSpeed 'Writes Burst preset max drive speed into the Max Extraction Speed text box
End Sub
Private Sub optSynch_Click() 'this sub starts when the user click on Synch Option
AudioCDRipper1.ripModePreset = SYNCH 'Sets Audio Ripber rip preset to SYNCH
txtRipRetriesOnError.Text = AudioCDRipper1.ripOnErrorRetries 'Writes Synch preset ripOnErrorRetries into the Retries on Read or Synch error text box
txtSpinUpTime.Text = AudioCDRipper1.driveSpinUpTime 'Writes Synch preset spinUpTime into the Spin Up Time text box
txtDriveSpeed.Text = AudioCDRipper1.driveSpeed 'Writes Synch preset max drive speed into the Max Extraction Speed text box
End Sub
Private Sub optSecure_Click() 'this sub starts when the user click on Secure Option
AudioCDRipper1.ripModePreset = SECURE 'Sets Audio Ripber rip preset to SECURE
txtRipRetriesOnError.Text = AudioCDRipper1.ripOnErrorRetries 'Writes Secure preset ripOnErrorRetries into the Retries on Read or Synch error text box
txtSpinUpTime.Text = AudioCDRipper1.driveSpinUpTime 'Writes Secure preset spinUpTime into the Spin Up Time text box
txtDriveSpeed.Text = AudioCDRipper1.driveSpeed 'Writes Secure preset max drive speed into the Max Extraction Speed text box
End Sub
Private Sub optParanoid_Click() 'this sub starts when the user click on Paranoid Option
AudioCDRipper1.ripModePreset = PARANOID 'Sets Audio Ripber rip preset to PARANOID
txtRipRetriesOnError.Text = AudioCDRipper1.ripOnErrorRetries 'Writes Paranoid preset ripOnErrorRetries into the Retries on Read or Synch error text box
txtSpinUpTime.Text = AudioCDRipper1.driveSpinUpTime 'Writes Paranoid preset spinUpTime into the Spin Up Time text box
txtDriveSpeed.Text = AudioCDRipper1.driveSpeed 'Writes Paranoid preset max drive speed into the Max Extraction Speed text box
End Sub
Private Sub optWAV_Click() 'this sub starts when the user click on WAV Option
fileType = 1 'Sets output file format to WAV
txtWAVFormatString.Enabled = True
txtMP3FormatString.Enabled = False
txtWMAFormatString.Enabled = False
txtOGGFormatString.Enabled = False
End Sub
Private Sub optOGG_Click() 'this sub starts when the user click on RAW Option
fileType = 3 'Sets output file format to RAW
txtWAVFormatString.Enabled = False
txtMP3FormatString.Enabled = False
txtWMAFormatString.Enabled = False
txtOGGFormatString.Enabled = True
End Sub
Private Sub optMP3_Click() 'this sub starts when the user click on MP3 Option
txtCDDBTimeOut.Text = AudioCDRipper1.cddbTimeOut 'Writes CDDB timeout to txtCDDBTimeOut text box
End Sub
Private Sub udTrackNum_Change() 'this sub starts on clicking the "Num" up down scroll buttons in the "CD Track Info" frame
AudioCDRipper1.trackNum = udTrackNum.Value 'sets the current number of audio CD track to the value set by the "Num" up down scroll buttons
txtTrackDuration.Text = Format(Int(AudioCDRipper1.trackDuration / 1000 / 60), "00") & ":" & Format((AudioCDRipper1.trackDuration / 1000) Mod 60, "00") 'writes to the "Duration" textbox in the "CD Track Info" frame the length of the CD track in hours:minutes:seconds format
txtTitle.Text = AudioCDRipper1.cddbInfoTitle 'writes CD track Tirle to the "Title" textbox in the "CD Track INfo" frame
End Sub
Private Sub RefreshCD() 'this sub starts when it is called by any other sub or function
StatusBar1.Panels(1).Text = "RefreshCD" 'Sets Status Bar panel to "RefreshCD" during this method works
udDriveNum.Min = 1 'Sets the minimum value of the "Num" updown scroll buttons in the "CD Info" frame to 1
udDriveNum.Max = AudioCDRipper1.driveCount 'Sets the Maximum value of the "Num" updown scroll buttons in the "CD Info" frame to maximal number of CD drives in the system
txtDriveLetter.Caption = AudioCDRipper1.driveLetter & "\" 'writes to the CD logical name textbox the name of the CD ripbed
txtDriveNum.Text = AudioCDRipper1.driveNum 'Writes to the "Num" textbox number of current CD drive in the system
txtDriveName.Text = AudioCDRipper1.driveName 'Writes to the "Drive" textbox name of the current CD drive in the system
txtDriveSpeed.Text = AudioCDRipper1.driveSpeed 'Writes the actual drive speed to txtDriveSpeed text box
txtSpinUpTime.Text = AudioCDRipper1.driveSpinUpTime 'Writes the actual spin up time to txtSpinUpTime text box
Select Case AudioCDRipper1.ripModePreset 'Depends on actual rip mode preset:
Case BURST 'if preset is Burst
optBurst.Value = True 'Sets the Burst option
Case SYNCH 'if preset is Synch
optSynch.Value = True 'Sets the Synch option
Case SECURE 'if preset is Secure
optSecure.Value = True 'Sets the Secure option
Case PARANOID 'if preset is Paranoid
optParanoid.Value = True 'Sets the Paranoid option
End Select
Select Case AudioCDRipper1.ripOnErrorAction 'Depends on actual rip on error action:
Case STOPGRAB 'if action on error is StopRip
optStop.Value = True 'Sets the Stop option
Case SILENCE 'if action on error is Silence
optSilence.Value = True 'Sets the Silence option
Case CUT 'if action on error is Cut
optCut.Value = True 'Sets the Cut option
Case CORRECT 'if action on error is Currect
optCorrect.Value = True 'Sets the Currect option
End Select
Select Case AudioCDRipper1.driveReadType 'Depends on drive read type:
Case CDRT_ANY 'if drive read type is CDRT_ANY
optAny.Value = True 'Sets the AUTO option
Case CDRT_ATAPI1 'if drive read type is CDRT_ATAPI1
optIDE.Value = True 'Sets the IDE option
Case CDRT_READ6 'if drive read type is CDRT_READ6
optSCSI1.Value = True 'Sets the SCSI(old) option
Case CDRT_READ10 'if drive read type is CDRT_READ10
optSCSI2.Value = True 'Sets the SCSI option
End Select
txtRipRetriesOnError.Text = AudioCDRipper1.ripOnErrorRetries 'Writes the actual rip on error retries to txtRipRetriesOnError text box
AudioCDRipper1.driveReadType = CDRT_ANY 'Sets drive Read Type to ANY (Auto Detect)
If AudioCDRipper1.trackCount <> 0 Then 'if number of tracks at the compact disk does not equal zero then
udTrackNum.Min = 1 'Sets the minimum value of the "Num" updown scroll buttons in the "CD Track Info" frame to 1
udTrackNum.Max = AudioCDRipper1.trackCount 'Sets the Maximum value of the "Num" updown scroll buttons in the "CD Track Info" frame to maximal number of tracks on the current CD
udTrackNum.Value = AudioCDRipper1.trackNum 'writes to the "Num" textbox the current tracknumber
txtTrackDuration.Text = Format(Int(AudioCDRipper1.trackDuration / 1000 / 60), "00") & ":" & Format((AudioCDRipper1.trackDuration / 1000) Mod 60, "00") 'writes to the "Duration" textbox in the "CD Track Info" frame the length of the CD track in hours:minutes:seconds format
ProgressBar1.Visible = False 'sets the progress bar invisible to the user
txtDriveStatus.Caption = "Idle" 'Extracting audio ends, drives stop read data
If errorBlocks <> 0 Then 'if there was blocks with unrecovered error
Select Case AudioCDRipper1.ripOnErrorAction 'depends on selected Action On Error
Case SILENCE: 'if it was Silence
MsgBox errorBlocks & " error blocks replaced with silence." 'informs user about silence error correction
Case CUT: 'if it was Cut
MsgBox errorBlocks & " error blocks cutted." 'informs user that error blocks was cutted
Case CORRECT: 'if it was Correct
MsgBox errorBlocks & " error blocks corrected." 'informs user that it was corrected
End Select
End If
cmdRip.Caption = "Rip Now!" 'Returns the rip button caption in it initial state
End Sub
Private Sub AudioCDRipper1_RipProgress(ByVal Percent As Long) 'this event sub occurs when block is completed in ripbing process
' DoEvents 'Yields execution so that operating system could produce the other events
If CancelRp = True Then
AudioCDRipper1.StopRip 'if CancelRp was set to true then stops ripbing procedureif
Else
txtDriveStatus.Caption = "Extracting Audio" 're-sets drive status label to the current drive status
ProgressBar1.Value = Percent
End If
If Percent = 100 Then
time2 = Now 'Gets the finishing time of ripbing procedure
FormStopRip 'return the form to it's initial state
If CancelRp = False Then 'if track ripbed from start to end, it was no StopRip clicks
MsgBox txtTitle.Text & " is ready now! Ripper speed: " & Format(AudioCDRipper1.trackDuration / DateDiff("s", time1, time2) / 1000, "#0.00") & " X." 'if the ripbing process was finished then produces the message box with the finishing message and ripbing time and speed
End If
txtDriveStatus.Caption = "Idle..."
RipInProgress = False
CancelRp = False 'Returns CancelRp variable in its default state if any
End If
' DoEvents 'Yields execution so that operating system could produce the other events
End Sub
Private Sub AudioCDRipper1_RipRetry(ByVal retryNum As Long) 'this event sub occurs when block is completed in ripbing process
txtDriveStatus.Caption = "Read or Synch Error! Retry: " & retryNum 'sets drive status label to the drive status
DoEvents 'Yields execution so that operating system could produce the other events
If CancelRp = True Then AudioCDRipper1.StopRip 'Cancel ripbing was set to true then stops ripbing procedureif
End Sub
Private Sub AudioCDRipper1_CDDBQueryStatus(ByVal cddbQueryStatus As CDDBQueryStatusConstants) 'this event informs AudioRipber ActiveX client about current status of CDDB query
Select Case cddbQueryStatus 'depends on CDDB query status
Case QUERY 'if status is Query
StatusBar1.Panels(4).Text = "CDDB Status: QUERY" 'Sets Status Bar Panel(4) to Query status
Case PROCESSANSWER 'if status is ProcessAnswer
StatusBar1.Panels(4).Text = "CDDB Status: PROCESS ANSWER" 'Sets Status Bar Panel(4) to Process Answer status
End Select
End Sub
Private Sub AudioCDRipper1_Error(ByVal Code As ErrcodeConstants) 'this event occurs when reading of track is completed after applying ReadTrack method
MsgBox "An error occures! Error Code " & Code 'produces the message box with a message about the error occuring
error = True
End Sub
Private Sub AudioCDRipper1_MediaChange() 'this event occurs when user eject or insert the disk
Inactive 'Inactive form controls that can't be use during refresh
RefreshCD 'Calls the RefreshCD sub
Active 'Active the form controls
End Sub
Private Sub Inactive() 'this sub inactives the form controls, that cannot be used during Play, Rip or Refresh operations
optBurst.Enabled = False
optSynch.Enabled = False
optSecure.Enabled = False
optParanoid.Enabled = False
optAny.Enabled = False
optIDE.Enabled = False
optSCSI1.Enabled = False
optSCSI2.Enabled = False
optStop.Enabled = False
optSilence.Enabled = False
optCut.Enabled = False
optCorrect.Enabled = False
cmdRefresh.Enabled = False
chkDriveLockTray.Enabled = False
chkUseExtASPI.Enabled = False
udSpinUpTime.Enabled = False
udRetries.Enabled = False
udDriveSpeed.Enabled = False
udTrackNum.Enabled = False
Eject.Enabled = False
optWAV.Enabled = False
optMP3.Enabled = False
optWMA.Enabled = False
optOGG.Enabled = False
txtSpinUpTime.Enabled = False
txtRipRetriesOnError.Enabled = False
txtDriveSpeed.Enabled = False
txtTrackNum.Enabled = False
udDriveNum.Enabled = False
txtDriveNum.Enabled = False
optCDDBAny.Enabled = False
optCDDBOnLine.Enabled = False
optCDPLAYERINI.Enabled = False
udTimeOut.Enabled = False
txtCDDBTimeOut.Enabled = False
cmdOGG.Enabled = False
cmdMP3.Enabled = False
udWMAProfile.Enabled = False
End Sub
Private Sub Active() 'Actives the form controls, that was disabled with Inactive()